package geon.config;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class Conn {

	private static String conn;
	private static String host;
	private static String port;
	private static String data;
	private static String user = "sa";
	private static String pass = "ca0105gx";

	private static Properties getProp() {
		Properties propriedade = new Properties();
		FileInputStream file;
		try {
			file = new FileInputStream("./properties/geon.properties");
			propriedade.load(file);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return propriedade;
	}

	public static String getConn() {
		Properties prop = getProp();
		host = prop.getProperty("geon.jdbc.host");
		port = prop.getProperty("geon.jdbc.port");
		data = prop.getProperty("geon.jdbc.data");
		conn = "jdbc:sqlserver://" + host + ":" + port + ";databaseName=" + data + ";";
		return conn;
	}

	public static String getUser() {
		return user;
	}

	public static String getPass() {
		return pass;
	}

}
